#include <windows.h>
#include <wininet.h>
#include <iostream>

int main()
{
    HINTERNET hInternet = InternetOpen("FTP Checker", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
    if (hInternet)
    {
        HINTERNET hFtp = InternetConnect(hInternet, "ftp.example.com", INTERNET_DEFAULT_FTP_PORT, "user", "pass", INTERNET_SERVICE_FTP, 0, 0);
        if (hFtp)
        {
            DWORD filesize;
            if (FtpGetFileSize(hFtp, "file.txt", &filesize, FTP_TRANSFER_TYPE_BINARY))
            {
                std::cout << "File size: " << filesize << " bytes" << std::endl;
            }
            InternetCloseHandle(hFtp);
        }
        InternetCloseHandle(hInternet);
    }
    return 0;
}